import 'package:flutter/material.dart';

///记得设置 floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
class CommonFloatingActionButton extends StatelessWidget {
  final String title;
  final Function myOnTap;

  const CommonFloatingActionButton(
    this.title,
    this.myOnTap, {
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: myOnTap,
      child: Container(
        margin: EdgeInsets.all(20),
        height: 47,
        decoration: BoxDecoration(
            color: Colors.green, borderRadius: BorderRadius.circular(10)),
        child: Center(
          child: Text(
            title,
            style: TextStyle(color: Colors.white),
          ),
        ),
      ),
    );
  }
}
